# Contributor: Alex Yam <alex@alexyam.com>
# Maintainer: Alex Yam <alex@alexyam.com>
pkgname=dhex
pkgver=0.69
pkgrel=1
pkgdesc="ncurses hex editor with diff mode for binary file comparison, supports custom themes"
url="http://www.dettus.net/dhex/"
arch="all"
license="GPL-2.0-or-later"
depends="ncurses-dev"
options="!check" # no test suite
source="http://www.dettus.net/dhex/dhex_$pkgver.tar.gz
	http://www.dettus.net/dhex/themes/dhexrc_default
	http://www.dettus.net/dhex/themes/dhexrc_green
	http://www.dettus.net/dhex/themes/dhexrc_red
	http://www.dettus.net/dhex/themes/dhexrc_white"
subpackages="$pkgname-doc"
builddir="$srcdir/${pkgname}_$pkgver"

build() {
	make
}

package() {
	# 'make install' is broken
	install -Dm755 dhex -t $pkgdir/usr/bin
	install -Dm644 dhex.1 -t $pkgdir/usr/share/man/man1
	install -Dm644 dhexrc.5 -t $pkgdir/usr/share/man/man5
	install -Dm644 dhex_markers.5 -t $pkgdir/usr/share/man/man5
	install -Dm644 dhex_searchlog.5 -t $pkgdir/usr/share/man/man5
	for t in dhexrc_default dhexrc_green dhexrc_red dhexrc_white; do
		install -Dm644 $srcdir/$t -t "$pkgdir"/usr/share/themes/dhex
	done
}

sha512sums="76115fd6b67bf1f61af6acfbc4dac9ac54c14aeb291de6a190aa1ffa599cf8b3e40a422ed34c237cf1f5c7406b07e38e38fb1c9c9dd36ce93d05265238060ba0  dhex_0.69.tar.gz
88105bc3ab5b8cd8d0ee4d9fcaef8ca01abe0c2a6372d0a65c1e334c13e149292e7a753380974035518c1a96521e3e79f33476a656ca17c82254fc775df066f2  dhexrc_default
c916a605a268cdcb645c1dc249ef9649dce9a3bed9efbabdb7f4f5142cf28ee672b74a3799bf268de9815e1a354a3b3920fc03ad3911fe9fc50064eefcc7084c  dhexrc_green
17abbd8f2afd8a663c117bbb6057ffb5f95eb1a55d206d46f8430ed62e276ac51fad0047528991750aae6ab0daf3cfebbe747c8885016602c680d693ba65a635  dhexrc_red
a8af1c03fbc3474179fbaa3db0b98ffefccc603092b73865ea288a3373c577a9acbcb5c5aa28b75da42909de497e26070027bfe8f4b22bc1d9b8ff997c39bf22  dhexrc_white"
